Python v3.7 HowTos:
Call an external command in python
Determine profiling of python programs
import multiprocessing print(multiprocessing.cpu_count())
Output:
4
See also
https://www.w3resource.com/python-exercises/python-basic-exercise-47.php